package cn.stu.cms.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

import static cn.stu.cms.common.CommonConstants.NULL_MSG;

/**
 * 公告
 *
 * @author gh
 * @date 2023/09/19
 */
@Data
public class Announcement extends BaseEntity implements Serializable {
    /**
     * 公告编号
     */
    @TableId(value = "announcement_id", type = IdType.AUTO)
    private Integer announcementId;

    /**
     * 标题
     */
    @NotBlank(message = NULL_MSG + "公告标题")
    @Length(max = 64, message = "公告标题不能超过{max}个字符")
    private String title;
    /**
     * 内容
     */
    @NotBlank(message = NULL_MSG + "公告内容")
    @Length(max = 8192, message = "公告内容不能超过{max}个字符")
    private String content;
}
